﻿using System.Collections.Generic;
using System.Linq;
using Magiq.Insert;
using Magiq.Query;

namespace Magiq.Providers.Objects
{
    public class InsertSourceEnumerableStrategy<TChild> : IEnumerableStrategy<TChild>
    {
        private readonly InsertSource<TChild> source;

        public InsertSourceEnumerableStrategy(InsertSource<TChild> source)
        {
            this.source = source;
        }

        #region IQueryStrategy<T> Members

        public IEnumerable<TChild> Execute()
        {
            return source.Queryable.ToArray();
        }

        #endregion
    }
}